package at.com.android.image;

import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;

public class ImageAdapter extends BaseAdapter{
	private Context mContext;
	private List<ImageItem> list_item;
	public ImageAdapter(Context c, List<ImageItem> obj){
		mContext = c;
		list_item = obj;
	}
	public int getCount(){
		return list_item.size();
	}
	public Object getItem(int position){
		return null;
	}
	public long getItemId(int position){
		return 0;
	}
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		View v;
		if(convertView == null){
			LayoutInflater inflater = LayoutInflater.from(mContext);
			v = inflater.inflate(R.layout.main, null);
			
			ImageView iv = (ImageView) v.findViewById(R.id.id_image);
			iv.setImageBitmap(list_item.get(position).getImg());
		}
		else{
			v = convertView;
		}
		return v;
	}
	
	
	

}
